package com.android.launcher3.manager;

import android.support.annotation.Nullable;

import com.android.launcher3.annotation.ToDoByDeson;

import java.util.ArrayList;
import java.util.List;

@ToDoByDeson
public enum TelephonyCellularManager {
    INSTANCE;

    private List<TelephonyCellularListener> listeners = new ArrayList<>();

    ///是否插入sim卡并激活
    boolean hasSimCardAndActivation() {
        return false;
    }

    @Nullable
    TelephonyCellularInfo getTelephonyCellularInfo() {
        return null;
    }

    void addListener(TelephonyCellularListener telephonyCellularListener) {
        listeners.add(telephonyCellularListener);
    }

    void cancelListener(TelephonyCellularListener telephonyCellularListener) {
        listeners.remove(telephonyCellularListener);
    }


    public static class TelephonyCellularInfo {

        String networkOperatorName;
        int signalStrength;

    }

    public interface TelephonyCellularListener {

        void onSimCardStatusChanged(SimStatus simStatus, @Nullable TelephonyCellularInfo telephonyCellularInfo);

        ///信号强度变化
        void signalStrengthChanges(int signalStrength);

    }

    public enum SimStatus {
        SIM_STATE_READY, SIM_STATE_ABSENT, SIM_STATE_NETWORK_LOCKED, SIM_STATE_PIN_REQUIRED, SIM_STATE_PUK_REQUIRED, SIM_STATE_UNKNOWN
    }

}
